const campuses = require("../methods/campuses");

module.exports = {
    getList: {
        exp: '获取校区列表',
        method: 'get',
        auth: true,
        async func(data) {
            return await campuses.getList()
        }
    },
    delete: {
        exp: '删除校区',
        method: 'post',
        auth: {
            admin: true
        },
        async func(data) {
            await campuses.delete(data.param.id)
        }
    },
    update: {
        exp: '更新校区',
        method: 'post',
        auth: {
            admin: true
        },
        async func(data) {
            await campuses.update(data.param.id, data.param.name)
        }
    },
    add: {
        exp: '添加校区',
        method: 'post',
        auth: {
            admin: true
        },
        async func(data) {
            await campuses.add(data.param.name)
        }
    },
}